;     include files
;     ~~~~~~~~~~~~~
      include windows.inc
      include gdi32.inc
      include user32.inc
      include kernel32.inc
      include Comctl32.inc
      include comdlg32.inc
      include shell32.inc
      include oleaut32.inc
      include msvcrt.inc
      include opengl32.inc
      include glu32.inc
      include glaux.inc
      include advapi32.inc
      include dsound.inc
      include winmm.inc
      include ole32.inc
      include version.inc
      include ws2_32.inc
		
;     libraries
;     ~~~~~~~~~
;      includelib \masm32\lib\gdi32.lib
;      includelib \masm32\lib\user32.lib
;      includelib \masm32\lib\kernel32.lib
;      includelib \masm32\lib\Comctl32.lib
;      includelib \masm32\lib\comdlg32.lib
;      includelib \masm32\lib\shell32.lib
;      includelib \masm32\lib\oleaut32.lib
;      includelib \masm32\lib\msvcrt.lib
;      includelib \masm32\lib\opengl32.lib
;      includelib \masm32\lib\glu32.lib
;      includelib \masm32\lib\glaux.lib
;      includelib \MASM32\lib\advapi32.lib
;      includelib \MASM32\lib\dsound.lib
;      includelib \MASM32\lib\winmm.lib
;      includelib \MASM32\lib\ole32.lib
;      includelib \MASM32\lib\version.lib
;      includelib \MASM32\lib\ws2_32.lib
; ---------------------------------------------------------------------------

_SCOPETABLE_ENTRY struc	; (sizeof=0xC, align=0x4) ; XREF: .rdata:stru_479578r
					; .rdata:stru_4795F8r ...
EnclosingLevel dd ?
FilterFunc dd ?				; offset
HandlerFunc dd ?			; offset
_SCOPETABLE_ENTRY ends

; ---------------------------------------------------------------------------

_EH3_EXCEPTION_REGISTRATION struc ; (sizeof=0x10, align=0x4, standard type)
					; XREF:	CPPEH_RECORDr
Next dd	?				; XREF:	___FrameUnwindToState+8Fr
					; CallCatchBlock(EHExceptionRecord *,EHRegistrationNode	*,_CONTEXT *,_s_FuncInfo const *,void *,int,ulong):loc_46D7F7r	... ; offset
ExceptionHandler dd ?			; offset
ScopeTable dd ?				; offset
TryLevel dd ?				; XREF:	start:loc_46C531w
					; ___FrameUnwindToState:loc_46D681w ...
_EH3_EXCEPTION_REGISTRATION ends

; ---------------------------------------------------------------------------

CPPEH_RECORD struc ; (sizeof=0x18, align=0x4) ;	XREF: startr
					; ___FrameUnwindToStater ...
old_esp	dd ?				; XREF:	start+23w start:loc_46C5B0r ...
exc_ptr	dd ?				; XREF:	start:loc_46C59Cr
					; ___FrameUnwindToState:loc_46D6A2r ... ; offset
registration _EH3_EXCEPTION_REGISTRATION <?> ; XREF: start:loc_46C531w
					; ___FrameUnwindToState:loc_46D681w ...
CPPEH_RECORD ends


; ---------------------------------------------------------------------------

_MMCKINFO struc	; (sizeof=0x14,	standard type) ; XREF: sub_401810r sub_401810r
ckid dd	?
cksize dd ?
fccType	dd ?
dwDataOffset dd	?
dwFlags	dd ?
_MMCKINFO ends


; ---------------------------------------------------------------------------

_devicemodeA_s1 struct ; (sizeof=0x8,	standard type)
dmOrientation dw ?
dmPaperSize dw ?
dmPaperLength dw ?
dmPaperWidth dw	?
dmScale	dw ?
dmCopies dw ?
dmDefaultSource	dw ?
dmPrintQuality dw ?
_devicemodeA_s1 ends

_devicemodeA_s2 struct
dmPosition dd ?
dmDisplayOrientation dd ?
dmDisplayFixedOutput dd ?
_devicemodeA_s2 ends

_devicemodeA_u1	union ;	(sizeof=0x8, standard type)
anonymous_0 _devicemodeA_s1 <?>
anonymous_1 _devicemodeA_s2 <?>
_devicemodeA_u1	ends


_devicemodeA struct ; (sizeof=0x9C, standard type)
dmDeviceName db	32 dup(?)
dmSpecVersion dw ?
dmDriverVersion	dw ?
dmSize dw ?
dmDriverExtra dw ?
dmFields dd ?
anonymous_0 _devicemodeA_s1 <?>
dmColor	dw ?
dmDuplex dw ?
dmYResolution dw ?
dmTTOption dw ?
dmCollate dw ?
dmFormName db 32 dup(?)
dmLogPixels dw ?
dmBitsPerPel dd	?
dmPelsWidth dd ?
dmPelsHeight dd	?
dmDisplayFlags dd ?
dmDisplayFrequency dd ?
dmICMMethod dd ?
dmICMIntent dd ?
dmMediaType dd ?
dmDitherType dd	?
dmReserved1 dd ?
dmReserved2 dd ?
dmPanningWidth dd ?
dmPanningHeight	dd ?
_devicemodeA ends

; ---------------------------------------------------------------------------

tagMSG struct ; (sizeof=0x1C, align=0x4,	standard type) ; XREF: _WinMain@16r
hwnd dd	?				; offset
message	dd ?
wParam dd ?
lParam dd ?
time dd	?
pt POINT <?>
tagMSG ends

; ---------------------------------------------------------------------------

WSAData	struc ;	(sizeof=0x190, align=0x4, standard type) ; XREF: sub_40CDA0r
wVersion dw ?
wHighVersion dw	?
szDescription db 257 dup(?)
szSystemStatus db 129 dup(?)
iMaxSockets dw ?
iMaxUdpDg dw ?
db ? ; undefined
db ? ; undefined
lpVendorInfo dd	?			; offset
WSAData	ends

; ---------------------------------------------------------------------------

sockaddr struc ; (sizeof=0x10, align=0x2, standard type) ; XREF: sub_40CEE0r
sa_family dw ?
sa_data	db 14 dup(?)
sockaddr ends

; ---------------------------------------------------------------------------

tagSIZE	struc ;	(sizeof=0x8, align=0x4,	standard type) ; XREF: .data:szr
					; .data:stru_7CC7EF0r ...
_cx dd ?
cy dd ?
tagSIZE	ends

; ---------------------------------------------------------------------------

_SYSTEMTIME struc ; (sizeof=0x10, align=0x2, standard type) ; XREF: sub_4556D0r
					; _timer ...
wYear dw ?
wMonth dw ?
wDayOfWeek dw ?
wDay dw	?
wHour dw ?
wMinute	dw ?
wSecond	dw ?
wMilliseconds dw ?
_SYSTEMTIME ends

; ---------------------------------------------------------------------------

_TIME_ZONE_INFORMATION struc ; (sizeof=0xAC, align=0x4,	standard type)
					; XREF:	.data:TimeZoneInformationr
					; _timer
Bias dd	?
StandardName dw	32 dup(?)
StandardDate SYSTEMTIME	<?>
StandardBias dd	?
DaylightName dw	32 dup(?)
DaylightDate SYSTEMTIME	<?>
DaylightBias dd	?
_TIME_ZONE_INFORMATION ends

; ---------------------------------------------------------------------------

SYSTEMTIME struc ; (sizeof=0x10, align=0x2, standard type)
					; XREF:	_TIME_ZONE_INFORMATIONr
					; _TIME_ZONE_INFORMATIONr
wYear dw ?
wMonth dw ?
wDayOfWeek dw ?
wDay dw	?
wHour dw ?
wMinute	dw ?
wSecond	dw ?
wMilliseconds dw ?
SYSTEMTIME ends

; ---------------------------------------------------------------------------

_STARTUPINFOA struc ; (sizeof=0x44, align=0x4, standard	type) ;	XREF: startr
					; __ioinitr ...
cb dd ?
lpReserved dd ?				; offset
lpDesktop dd ?				; offset
lpTitle	dd ?				; offset
dwX dd ?
dwY dd ?
dwXSize	dd ?
dwYSize	dd ?
dwXCountChars dd ?
dwYCountChars dd ?
dwFillAttribute	dd ?
dwFlags	dd ?				; XREF:	start+98w start+ADr
wShowWindow dw ?			; XREF:	start+B3r
cbReserved2 dw ?			; XREF:	__ioinit+5Fr
lpReserved2 dd ?			; XREF:	__ioinit+6Br ;	offset
hStdInput dd ?				; offset
hStdOutput dd ?				; offset
hStdError dd ?				; offset
_STARTUPINFOA ends

; ---------------------------------------------------------------------------

_cpinfo	struc ;	(sizeof=0x14, align=0x4, standard type)	; XREF:	__setmbcpr
					; _setSBUpLowr	...
MaxCharSize dd ?
DefaultChar db 2 dup(?)
LeadByte db 12 dup(?)
db ? ; undefined
db ? ; undefined
_cpinfo	ends

; ---------------------------------------------------------------------------

_OSVERSIONINFOA	struc ;	(sizeof=0x94, align=0x4, standard type)
					; XREF:	_IsThisWindowsNTr
dwOSVersionInfoSize dd ?
dwMajorVersion dd ?
dwMinorVersion dd ?
dwBuildNumber dd ?
dwPlatformId dd	?
szCSDVersion db	128 dup(?)
_OSVERSIONINFOA	ends

; ---------------------------------------------------------------------------

_SECURITY_ATTRIBUTES struc ; (sizeof=0xC, align=0x4, standard type) ; XREF: __sopenr
nLength	dd ?
lpSecurityDescriptor dd	?		; offset
bInheritHandle dd ?
_SECURITY_ATTRIBUTES ends

; ---------------------------------------------------------------------------

_PROCESS_INFORMATION struc ; (sizeof=0x10, align=0x4, standard type) ; XREF: __dospawnr
hProcess dd ?				; XREF:	__dospawn+19Fr	__dospawn+1ACr	... ; offset
hThread	dd ?				; XREF:	__dospawn:loc_4773DEr ; offset
dwProcessId dd ?
dwThreadId dd ?
_PROCESS_INFORMATION ends

; ---------------------------------------------------------------------------

FILE struc ; (sizeof=0x20, align=0x4, standard type) ; XREF: .data:stru_484018r
					; ReadMuText_44DC70r ...
_ptr dd	?				; offset
_cnt dd	?
_base dd ?				; offset
_flag dd ?
_file dd ?
_charbuf dd ?
_bufsiz	dd ?
_tmpfname dd ?				; offset
FILE ends

; ---------------------------------------------------------------------------

HWND__ struc ; (sizeof=0x4, align=0x4, standard	type) ;	XREF: sub_477690r
unused dd ?
HWND__ ends

; ---------------------------------------------------------------------------

_msExcInfo struc ; (sizeof=0x8)		; XREF:	_msExceptr
Id dd ?					; base 10
Proc1 dd	?				; offset
_msExcInfo ends

; ---------------------------------------------------------------------------

_msExcept struc	; (sizeof=0x20,	variable size) ; XREF: .rdata:stru_47A398r
					; .rdata:stru_47A3C0r
Magic dd ?				; base 16
Count dd ?				; base 10
InfoPtr	dd ?				; offset
CountDtr dd ?				; base 10
DtrPtr dd ?				; offset
_unk dd	3 dup(?)
Info _msExcInfo	<?>	; XREF:	.rdata:stru_47A398o
					; .rdata:stru_47A3C0o
_msExcept ends

; ---------------------------------------------------------------------------

; (Class Informer)
type_info struc	; (sizeof=0x8, variable	size)
vftable	dd ?				; offset (00000000)
_m_data	dd ?
_m_d_name db 0 dup(?)			; string(C)
type_info ends

; ---------------------------------------------------------------------------

; (Class Informer)
PMD struc ; (sizeof=0xC)		; XREF:	RTTIBaseClassDescriptorr
mdisp dd ?
pdisp dd ?
vdisp dd ?
PMD ends

; ---------------------------------------------------------------------------

; (Class Informer)
RTTIBaseClassDescriptor	struc ;	(sizeof=0x18)
pTypeDescriptor	dd ?			; offset (00000000)
numContainedBases dd ?
pmd PMD	<?>
attributes dd ?
RTTIBaseClassDescriptor	ends

; ---------------------------------------------------------------------------

; (Class Informer)
RTTIClassHierarchyDescriptor struc ; (sizeof=0x10)
signature dd ?
attributes dd ?
numBaseClasses dd ?
pBaseClassArray	dd ?			; offset (00000000)
RTTIClassHierarchyDescriptor ends

; ---------------------------------------------------------------------------

; (Class Informer)
RTTICompleteObjectLocator struc	; (sizeof=0x14)
signature dd ?
offset1 dd ?
cdOffset dd ?
pTypeDescriptor	dd ?			; offset (00000000)
pClassDescriptor dd ?			; offset (00000000)
RTTICompleteObjectLocator ends

; ---------------------------------------------------------------------------

; MFC "Run Time	Class Information" (Class Informer)
RTCI struc ; (sizeof=0x1C)
m_lpszClassName	dd ?			; offset (00000000)
m_nObjectSize dd ?
m_wSchema dd ?
m_pfnCreateObject dd ?			; offset (00000000)
m_pfnGetBaseClass dd ?			; offset (00000000)
m_pNextClass dd	?
m_pClassInit dd	?
RTCI ends

_rand equ crt_rand
_setlocale equ crt_setlocale
_fopen equ crt_fopen
__ftol equ crt__ftol
_atoi equ crt_atoi
_fgetc equ crt_fgetc
_isspace equ crt_isspace
_ungetc equ crt_ungetc
_isdigit equ crt_isdigit
_atof equ crt_atof
_isalpha equ crt_isalpha
_isalnum equ crt_isalnum
_fclose equ crt_fclose
_islower equ crt_islower
_toupper equ crt_toupper
_isupper equ crt_isupper
_tolower equ crt_tolower
_strchr equ crt_strchr
_fread equ crt_fread
_fwrite equ crt_fwrite
_longjmp equ crt_longjmp
_fseek equ crt_fseek
__setjmp3 equ crt__setjmp3
_ftell equ crt_ftell
__mbclen equ crt__mbclen
_strncmp equ crt_strncmp
__strcmpi equ crt__strcmpi
__CIacos equ crt__CIacos
__itoa equ crt__itoa
_getenv equ crt_getenv
_exit equ crt_exit
_fflush equ crt_fflush
_malloc equ crt_malloc
_free equ crt_free
_flsall equ _flsall

IFDEF BUILD_VC6
	_atexit equ crt_atexit
	_time equ <crt_time>
	_printf equ crt_printf
	_fprintf equ crt_fprintf
	_sprintf equ crt_sprintf
	_fscanf equ crt_fscanf
	_sscanf equ crt_sscanf
	__flsbuf equ crt__flsbuf
	__filbuf equ crt__filbuf
ELSE
	extern my_fprintf:proc
	_fprintf equ my_fprintf

	extern my_sprintf:proc
	_sprintf equ my_sprintf

	extern my_printf:proc
	_printf equ my_printf

	extern my_fscanf:proc
	_fscanf equ my_fscanf

	extern my_sscanf:proc
	_sscanf equ my_sscanf

	extern my_filbuf:proc
	__filbuf equ my_filbuf

	extern my_flsbuf:proc
	__flsbuf equ my_flsbuf

	extern my_time:proc
	_time equ my_time

	extern my_atexit:proc
	_atexit equ my_atexit

ENDIF ;BUILD_VC6
